home *** CD-ROM | disk | FTP | other *** search
- program DemoB007;
- {------------------------------------------------------------------------------
- DBase Memo File Lister
- Sample 7
- Demo Program
-
- Copyright (c) Richard F. Griffin
-
- 10 February 1992
-
- 102 Molded Stone Pl
- Warner Robins, GA 31088
-
- -------------------------------------------------------------
- This program demonstrates how dBase memo records may be listed
- using Griffin Solutions units.
-
- The program initializes a dBase file object, opens the file, and
- proceeds to list selected fields from each record along with its
- memo record.
-
- -------------------------------------------------------------------------------}
-
- uses
- CRT,
- DOS,
- GS_Date,
- GS_dBase,
- GS_DBFld,
- GS_FileH,
- GS_GenF;
- var
- MyFile : GS_dBFld_Objt;
- CkFile : file;
- c : char;
-
- {Procedure to display the memo field}
-
- procedure ShowTheMemo;
- var
- i,
- ml : integer;
-
- begin
- MyFile.MemoGet(MyFile.FieldGet('COMMENTS'));
- ml := MyFile.MemoLines;
- if ml <> 0 then
- for i := 1 to ml do
- writeln(MyFile.MemoGetLine(i))
- else writeln('[ EMPTY ]');
- writeln;
- end;
-
- {Main program}
-
- begin
- GS_Date_Century := true; {Gives full century on date display (YYYY)}
- {default is false for YY only.}
- ClrScr;
- if not GS_FileExists(CkFile,'DEMOB7.DBF') then
- begin
- writeln('Creating DEMOB7.DBF');
- MakeTestData('DEMOB7', 20, true);
- writeln('DEMOB7.DBF Created');
- ClrScr;
- end;
-
- MyFile.Init('DEMOB7');
- MyFile.Open;
- MyFile.MemoWidth(75); {sets width of the memo line. Default is 50}
- MyFile.GetRec(Top_Record);
- while not MyFile.File_EOF do
- begin
- ClrScr;
- writeln(MyFile.FieldGet('LASTNAME'),', ',
- MyFile.FieldGet('FIRSTNAME'));
- ShowTheMemo;
- write('Press any key....');
- c := ReadKey;
- writeln;
- MyFile.GetRec(Next_Record); {Get the next sequential record}
- end;
- MyFile.Close;
- end.
-
-